<template>
  <el-row :gutter="2">
    <el-col :span="4">
      <el-input @input="inputAccount" :value=account placeholder="账号"/>
    </el-col>
    <el-col :span="4">
      <el-input @input="inputName" :value=name placeholder="名称"/>
    </el-col>
    <el-col :span="4">
      <el-select v-model="value" clearable placeholder="选择状态" @change="selectItem">
        <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.value"
            :value="item.label">
        </el-option>
      </el-select>
    </el-col>
    <el-col :span="1.5">
      <EButton :title="'查询'" :color="'primary'" @checkout="checkout"/>
    </el-col>
    <el-col :span="1.5">
      <EButton :title="'添加'" :color="'info'" @addEnterprise="addEnterprise($event)"/>
    </el-col>
  </el-row>
</template>

<script>
  /* eslint-disable */
  import EButton from '@/components/ButtonBox/index'
  export default {
    name: 'Index',
    data() {
      return {
        name: "",
        account:"",
        options: [{
          label:0,
          value: '启用'
        }, {
          label:1,
          value: '冻结'
        }],
        value: ''
      };
    },
    components:{
      EButton,
    },
    methods: {
      addEnterprise(e) {
        this.$emit('addEnterprise',e)
      },
      checkout(){
        let data={
          id:this.account,
          userName:this.name,
          loginLock:this.options.value,
        };
        this.$emit("checkout2",data)
        this.$emit("checkout2",data)
      },
      inputName(val){
          this.name=val.trim();
      },
      inputAccount(val){
         this.account=val.trim();
      },
      selectItem(item){
        this.options.value=item;
      }
    }
  }
</script>

<style scoped>

</style>
